package com.konne.nightmare.FastPublicOpinion.mvp.presenter;


import com.konne.nightmare.FastPublicOpinion.base.BaseMvpPresenter;
import com.konne.nightmare.FastPublicOpinion.base.OnLoadDataListener;
import com.konne.nightmare.FastPublicOpinion.bean.UserInfoBean;
import com.konne.nightmare.FastPublicOpinion.http.BaseResponse;
import com.konne.nightmare.FastPublicOpinion.mvp.model.IHomeFragmentModel;
import com.konne.nightmare.FastPublicOpinion.mvp.model.IUserFragmentModel;
import com.konne.nightmare.FastPublicOpinion.mvp.model.impl.HomeFragmentModelImpl;
import com.konne.nightmare.FastPublicOpinion.mvp.model.impl.UserFragmentModelImpl;
import com.konne.nightmare.FastPublicOpinion.mvp.view.IHomeFragmentView;
import com.konne.nightmare.FastPublicOpinion.mvp.view.IUserFragmentView;


public class UserPresenter extends BaseMvpPresenter<IUserFragmentView> {
    private IUserFragmentModel iUserFragmentModel;

    public UserPresenter() {
        iUserFragmentModel = new UserFragmentModelImpl();
    }
    public void getInfo() {
        if (mView == null) return;

        iUserFragmentModel.getInfo( new OnLoadDataListener<UserInfoBean.DataBean>() {
            @Override
            public void onSuccess(BaseResponse<UserInfoBean.DataBean> t) {
                getView().getInfo(t);
                getView().cancelLoadDialog();
            }

            @Override
            public void onFailure(String error) {
                getView().cancelLoadDialog();
            }
        });
    }


}
